<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
$(function(){
	$('#user_log_logForm').form({
	      url : '${pageContext.request.contextPath}/userAction!log.action',
	      success:function(r){
	      var obj=jQuery.parseJSON(r);
	      /* console.info(obj); */	
	      if(obj.success){
	         $('#user_log_logDialog').dialog('close');
	         loadTree();
	      }
	      $.messager.show({
            title:'提示',
            msg:obj.msg
      });		
	}
});
	loadTree=function(){
		$('#tree').tree({
		    url : '${pageContext.request.contextPath}/menuAction!getTree.action',
		    parentField : 'pid',
		    lines : true,
		    onClick : function(node){
			  if(node.attributes.url){
			  var url='${pageContext.request.contextPath}'+node.attributes.url;
			  addTab({
				  title : node.text,
				  href : url,
				  closable : true
				  });
		        }
		     }
	    });
     };
	/* 回车提交功能 */
	 $('#user_log_logForm input').bind('keyup',function(event){
		if(event.keyCode=='13'){
			$('#user_log_logForm').submit();
		}
	}); 
	$('#user_log_logForm input[name="logname"]').focus();
});	
</script>
<div id="user_log_logDialog" class="easyui-dialog" data-options="title:'login',modal:true,closable:false,buttons:[{text:'注册',iconCls:'icon-edit',handler:function(){
		$('#user_reg_regForm input').val('');
		$('#user_reg_regDialog').dialog('open');
		}},{text:'登录',iconCls:'icon-man',handler:function(){
		 $('#user_log_logForm').submit();
		}
		}]">
		<form id="user_log_logForm" method="post">
		<table>
		<tr>
		<th>name</th>
		<td><input name="logname" class="easyui-validatebox" data-options="required:true,validType:'',invalidMessage:'',missingMessage:'该项必填'"/></td>
		</tr>
		<tr>
		<th>password</th>
		<td><input name="pwd" type="password"class="easyui-validatebox" data-options="required:true"/></td>
		</tr>
		</table>
		</form>
		</div>